package com.yupao.common;

import com.yupao.model.enums.ErrorCode;
import lombok.Data;

/**
 * 通用返回类
 * @param <T>
 */
@Data
public class BaseResponse<T> {

    private int code;
    private  T data;
    private String msg;

    public BaseResponse(int code, T data, String msg){
        this.code = code;
        this.data = data;
        this.msg = msg;
    }


    public BaseResponse(ErrorCode errorCode){
        this(errorCode.getCode(), null, errorCode.getMessage());
    }

}
